package com.example.service;

import com.example.fallback.ProductServiceFallback;
import com.example.fallback.ProductServiceFallbackFactory;
import com.example.pojo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author yinyin
 * @create 2021/07/14 下午 3:34
 */
//声明需要调用的服务和服务熔断处理类
@FeignClient(value = "product-service" ,fallbackFactory = ProductServiceFallbackFactory.class )
public interface ProductService {
    @GetMapping("product/list")
    List<Product> selectProductList();
    @GetMapping("product/listByIds")
    List<Product>  selectProductListByIds(@RequestParam("id") List<Integer> ids);
    @GetMapping("product/listById/{id}")
    Product selectProductById(@PathVariable("id") Integer id);
}
